package org.example.service.impl;

import org.example.domain.CarClient;
import org.example.dto.CarClientDto;
import org.example.mapper.CarClientMapper;
import org.example.service.CarClientService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * @author : Guosir
 * @date : 2024-06-29 09:49
 * @description :
 **/
@Service
public class CarClientServiceImpl implements CarClientService {

    @Autowired
    CarClientMapper carClientMapper;


    @Override
    public CarClient getOne(String clientName) {
        return carClientMapper.getOne(clientName);
    }

    @Override
    public CarClient selectByClientId(Integer clientId) {
        return carClientMapper.selectByClientId(clientId);
    }


    @Override
    public List<CarClient> carClientList(CarClientDto carClientDto) {
        return carClientMapper.carClientList(carClientDto);
    }

    @Override
    public List<CarClient> list() {
        return carClientMapper.list();
    }

    @Override
    public void insert(List<CarClient> cacheList) {
        carClientMapper.insert(cacheList);
    }

    @Override
    public void saveClient(CarClient carClient) {
        carClient.setCreateTime(new Date());
        carClientMapper.saveClient(carClient);
    }

    @Override
    public void del(Integer clientId) {
        carClientMapper.del(clientId);
    }


}
